<Bindings>
	<Binding name="SW_BIND_TOGGLEBARS" header="SW_BINDINGS" runOnUp="true">
		if ( keystate == "down" ) then
			SW_ToggleBarFrame();
		end
	</Binding>
	<Binding name="SW_BIND_CONSOLE" runOnUp="true">
		if ( keystate == "down" ) then
			SW_ToggleConsole();
		end
	</Binding>
	<Binding name="SW_BIND_PAGE1" >
		if ( keystate == "down" ) then
			SW_OptKey("1");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE2" >
		if ( keystate == "down" ) then
			SW_OptKey("2");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE3" >
		if ( keystate == "down" ) then
			SW_OptKey("3");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE4" >
		if ( keystate == "down" ) then
			SW_OptKey("4");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE5" >
		if ( keystate == "down" ) then
			SW_OptKey("5");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE6" >
		if ( keystate == "down" ) then
			SW_OptKey("6");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE7" >
		if ( keystate == "down" ) then
			SW_OptKey("7");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE8" >
		if ( keystate == "down" ) then
			SW_OptKey("8");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE9" >
		if ( keystate == "down" ) then
			SW_OptKey("9");
		end
	</Binding>
	<Binding name="SW_BIND_PAGE10" >
		if ( keystate == "down" ) then
			SW_OptKey("10");
		end
	</Binding>
	<Binding name="SW_BIND_PAGENEXT" >
		if ( keystate == "down" ) then
			local se;
			if SW_Settings.BarFrames then
				se = SW_Settings.BarFrames.SW_BarFrame1
			end
			if not (se and se.Selected) then
				return;
			end
			
			if se.Selected + 1 > SW_OPT_COUNT then
				SW_OptKey(1);
			else
				SW_OptKey(se.Selected + 1);
			end
		end
	</Binding>
	<Binding name="SW_BIND_PAGEPREV" >
		if ( keystate == "down" ) then
			local se;
			if SW_Settings.BarFrames then
				se = SW_Settings.BarFrames.SW_BarFrame1
			end
			if not (se and se.Selected) then
				return;
			end
			
			if se.Selected == 1 then
				SW_OptKey(SW_OPT_COUNT);
			else
				SW_OptKey(se.Selected - 1);
			end
		end
	</Binding>
	<Binding name="SW_BIND_SELECTTARGET" >
		if ( keystate == "down" ) then
			local se;
			if SW_Settings.BarFrames then
				se = SW_Settings.BarFrames.SW_BarFrame1
			end
			if not (se and se.Selected) then
				return;
			end
			if SW_Settings.InfoSettings and SW_Settings.InfoSettings[se.Selected] then
				SW_Settings.InfoSettings[se.Selected].TV = UnitName("target");
				-- update the text
				if SW_BarSettingsFrameV2:IsVisible() then
					SW_BarSettingsFrameV2:Hide();
					SW_BarSettingsFrameV2:Show();
				end
			end
		end
	</Binding>
	<Binding name="SW_BIND_COPYBUTTON" >
		if ( keystate == "down" ) then
			SW_COPY_TARGET = SW_DC(SW_Settings.InfoSettings[ SW_Settings.BarFrames.SW_BarFrame1.Selected ]);
		end
	</Binding>
	<Binding name="SW_BIND_PASTEBUTTON" >
		if ( keystate == "down" ) then
			if not SW_COPY_TARGET then return end;
			SW_Settings.InfoSettings[ SW_Settings.BarFrames.SW_BarFrame1.Selected ] = SW_DC(SW_COPY_TARGET);
			SW_BarLayoutRegisterd();
			if SW_BarFrame1:IsVisible() then
				SW_BarFrame1:Hide();
				
				SW_BarFrame1:Show();
			end
		end
	</Binding>
</Bindings>